<template>
  <div class="home">
    <div class="home-main"></div>
    <div class="home-fixed">
      <div class="home-logo">
        <img src="../assets/img/home_logo.png" alt />
      </div>
      <div class="home-tips">请先选择业务类型</div>
      <div class="home-change">
        <a href="javascript:;" @click="changeType(0)">零售</a>
        <a href="javascript:;" @click="changeType(1)">商用</a>
      </div>
    </div>
  </div>
</template>
<script>
  import {mapActions} from "vuex"
  export default {
    name: 'home',
    methods: {
      changeType(type) {
        this.$store.dispatch('setType/getType', type)
        this.$router.push({path: '/index', query: {type: type}})
      }
    },
  }
</script>
<style lang="less" scoped>
.home {
  min-width: 320px;
  max-width: 750px;
  position: absolute;
  width: 100%;
  height: 100%;
  color: #fff;
  text-align: center;

  .home-main {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(../assets/img/home.png) no-repeat;
    background-size: cover;
    background-attachment: fixed;
    overflow: hidden;
    z-index: -1;
  }

  .home-fixed {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 99;
  }

  .home-logo img {
    width: 60%;
  }

  .home-tips {
    font-size: 0.28rem;
    margin: 2.17rem 0 0.81rem 0;
  }

  .home-change a {
    position: relative;
    display: block;
    font-size: 0.32rem;
    color: #fff;
    width: 50%;
    margin: 0.45rem auto;
    height: 0.72rem;
    line-height: 0.72rem;
    border: 2px solid #fff;
    font-weight: bold;
  }
}
</style>
